import Vue from "vue";

import Cookies from "js-cookie";

import Element from "element-ui";
import dayjs from "dayjs";
import "./assets/styles/element-variables.scss";

import "@/assets/styles/ans.scss"; // 公共 css
import "@/assets/styles/index.scss"; // global css
import "@/assets/styles/ruoyi.scss"; // ruoyi css
import "@/assets/styles/common.scss"; // 公共 css

import App from "./App";
import store from "./store";
import router from "./router";
import scroll from "vue-seamless-scroll";

Vue.use(scroll);
import "./permission"; // permission control
// 复制工具
import VueClipboard from "vue-clipboard2";
Vue.use(VueClipboard);

// 响应式单位
import flexible from "@/utils/flexible";
Vue.use(flexible);

// 全局方法挂载
Vue.prototype.$dayjs = dayjs;

Vue.prototype.msgSuccess = function (msg) {
  this.$message({ showClose: true, message: msg, type: "success" });
};

Vue.prototype.msgError = function (msg) {
  this.$message({ showClose: true, message: msg, type: "error" });
};

Vue.prototype.msgInfo = function (msg) {
  this.$message.info(msg);
};

/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online! ! !
 */

Vue.use(Element, {
  size: Cookies.get("size") || "mini", // set element-ui default size
});

Vue.config.productionTip = false;

new Vue({
  el: "#app",
  router,
  store,
  render: (h) => h(App),
});
